Skip to content

Conversation

@innocenzi
Copy link
Member

This pull request adds support for mapping an array of enums or serialized enums.

final class User
{
    /** @var \App\Role[] */
    public array $roles;
}

enum Role: string
{
    case ADMIN = 'admin';
    case USER = 'user';
}
// This now works
query(User::class)->first();

// This as well
map(['roles' => ['admin'])->to(User::class);

@brendt brendt merged commit 122d7a3 into 2.x Aug 18, 2025
98 of 101 checks passed
@brendt brendt deleted the feat/map-serialized-enums branch August 18, 2025 12:56
Bapawe pushed a commit to Bapawe/tempest-framework that referenced this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants